Stop adding "(Disabled)" to disabled agents.

They are now distinguished by the color and line style.

Akinori MUSHA 10 years ago
parent
commit
18175330fc
2 changed files with 3 additions and 7 deletions
  1. 1 5
      app/helpers/dot_helper.rb
  2. 2 2
      spec/helpers/dot_helper_spec.rb

+ 1 - 5
app/helpers/dot_helper.rb

@@ -112,11 +112,7 @@ module DotHelper
112 112
     draw(agents: agents,
113 113
          agent_id: ->agent { 'a%d' % agent.id },
114 114
          agent_label: ->agent {
115
-           if agent.disabled?
116
-             '%s (Disabled)' % agent.name
117
-           else
118
-             agent.name
119
-           end.gsub(/(.{20}\S*)\s+/) {
115
+           agent.name.gsub(/(.{20}\S*)\s+/) {
120 116
              # Fold after every 20+ characters
121 117
              $1 + "\n"
122 118
            }

+ 2 - 2
spec/helpers/dot_helper_spec.rb

@@ -62,7 +62,7 @@ describe DotHelper do
62 62
             \k<foo> -> (?<bar1>\w+) \[style=dashed\];
63 63
             \k<foo> -> (?<bar2>\w+) \[color="\#999999"\];
64 64
             \k<bar1> \[label=bar1\];
65
-            \k<bar2> \[label="bar2 \s \(Disabled\)",style="rounded,dashed",color="\#999999",fontcolor="\#999999"\];
65
+            \k<bar2> \[label=bar2,style="rounded,dashed",color="\#999999",fontcolor="\#999999"\];
66 66
             \k<bar2> -> (?<bar3>\w+) \[style=dashed,color="\#999999"\];
67 67
             \k<bar3> \[label=bar3\];
68 68
           \}
@@ -79,7 +79,7 @@ describe DotHelper do
79 79
             \k<foo> -> (?<bar1>\w+) \[style=dashed\];
80 80
             \k<foo> -> (?<bar2>\w+) \[color="\#999999"\];
81 81
             \k<bar1> \[label=bar1,URL="#{Regexp.quote(agent_path(@bar1))}"\];
82
-            \k<bar2> \[label="bar2 \s \(Disabled\)",URL="#{Regexp.quote(agent_path(@bar2))}",style="rounded,dashed",color="\#999999",fontcolor="\#999999"\];
82
+            \k<bar2> \[label=bar2,URL="#{Regexp.quote(agent_path(@bar2))}",style="rounded,dashed",color="\#999999",fontcolor="\#999999"\];
83 83
             \k<bar2> -> (?<bar3>\w+) \[style=dashed,color="\#999999"\];
84 84
             \k<bar3> \[label=bar3,URL="#{Regexp.quote(agent_path(@bar3))}"\];
85 85
           \}